<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<p>摄氏度:<input id="cd" type="text" size="15"></input></p>
		<p>华氏度:<input id="hd" type="text" size="15"></input></p>
	</body>
</html>
<script>
	var wd1,wd2;
	wd1 = prompt("请输入摄氏度温度",10);
	wd1 = parseFloat(wd1);
	if (isNaN(wd1)) {
		alert("输入数据不合法!")
	} else{
		wd2 = (wd1 * 9) / 5+32;
		document.getElementById("cd").value = wd1+"°C";
		document.getElementById("hd").value = wd2+"F";
	}
</script>